<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QSourceLocation Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QSourceLocation Class Reference<br /><sup><sup>[<a href="qtxmlpatterns.html">QtXmlPatterns</a> module]</sup></sup></h1><p>The QSourceLocation class identifies a location in a resource by
URI, line, and column. <a href="#details">More...</a></p>

<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qsourcelocation.html#QSourceLocation">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qsourcelocation.html#QSourceLocation-2">__init__</a></b> (<i>self</i>, QSourceLocation&#160;<i>other</i>)</li><li><div class="fn" /><b><a href="qsourcelocation.html#QSourceLocation-3">__init__</a></b> (<i>self</i>, QUrl&#160;<i>u</i>, int&#160;<i>line</i>&#160;=&#160;-1, int&#160;<i>column</i>&#160;=&#160;-1)</li><li><div class="fn" />int <b><a href="qsourcelocation.html#column">column</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qsourcelocation.html#isNull">isNull</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qsourcelocation.html#line">line</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qsourcelocation.html#setColumn">setColumn</a></b> (<i>self</i>, int&#160;<i>newColumn</i>)</li><li><div class="fn" /><b><a href="qsourcelocation.html#setLine">setLine</a></b> (<i>self</i>, int&#160;<i>newLine</i>)</li><li><div class="fn" /><b><a href="qsourcelocation.html#setUri">setUri</a></b> (<i>self</i>, QUrl&#160;<i>newUri</i>)</li><li><div class="fn" />QUrl <b><a href="qsourcelocation.html#uri">uri</a></b> (<i>self</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qsourcelocation.html#__eq__">__eq__</a></b> (<i>self</i>, QSourceLocation&#160;<i>other</i>)</li><li><div class="fn" />int <b><a href="qsourcelocation.html#__hash__">__hash__</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qsourcelocation.html#__ne__">__ne__</a></b> (<i>self</i>, QSourceLocation&#160;<i>other</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QSourceLocation class identifies a location in a resource by
URI, line, and column.</p>
<p>QSourceLocation is a simple value based class that has three
properties, <a href="qsourcelocation.html#uri">uri</a>(), <a href="qsourcelocation.html#line">line</a>(), and <a href="qsourcelocation.html#column">column</a>(), that, taken together,
identify a certain point in a resource, e.g., a file or an
in-memory document.</p>
<p><a href="qsourcelocation.html#line">line</a>() and <a href="qsourcelocation.html#column">column</a>() refer to character
counts (not byte counts), and they both start from 1, as opposed to
0.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QSourceLocation" />QSourceLocation.__init__ (<i>self</i>)</h3><p>Construct a <a href="qsourcelocation.html">QSourceLocation</a>
that doesn't identify anything at all.</p>
<p>For a default constructed QSourceLocation(), <a href="qsourcelocation.html#isNull">isNull</a>() returns
<tt>true</tt>.</p>


<h3 class="fn"><a name="QSourceLocation-2" />QSourceLocation.__init__ (<i>self</i>, <a href="qsourcelocation.html">QSourceLocation</a>&#160;<i>other</i>)</h3><p>Constructs a <a href="qsourcelocation.html">QSourceLocation</a>
that is a copy of <i>other</i>.</p>


<h3 class="fn"><a name="QSourceLocation-3" />QSourceLocation.__init__ (<i>self</i>, <a href="qurl.html">QUrl</a>&#160;<i>u</i>, int&#160;<i>line</i>&#160;=&#160;-1, int&#160;<i>column</i>&#160;=&#160;-1)</h3><p>Constructs a <a href="qsourcelocation.html">QSourceLocation</a>
with URI <i>u</i>, line <i>l</i> and column <i>c</i>.</p>


<h3 class="fn"><a name="column" />int QSourceLocation.column (<i>self</i>)</h3><p>Returns the current column number. The column number refers to
the count of characters, not bytes. The first column is column 1,
not 0. The default value is -1, indicating the column number is
unknown.</p>
<p><b>See also</b> <a href="qsourcelocation.html#setColumn">setColumn</a>().</p>


<h3 class="fn"><a name="isNull" />bool QSourceLocation.isNull (<i>self</i>)</h3><p>Returns <tt>true</tt> if this <a href="qsourcelocation.html">QSourceLocation</a> doesn't identify
anything.</p>
<p>For a default constructed <a href="qsourcelocation.html">QSourceLocation</a>, this function returns
<tt>true</tt>. The same applies for any other <a href="qsourcelocation.html">QSourceLocation</a> whose <a href="qsourcelocation.html#uri">uri</a>() is invalid.</p>


<h3 class="fn"><a name="line" />int QSourceLocation.line (<i>self</i>)</h3><p>Returns the current line number. The first line number is 1, not
0. The default value is -1, indicating the line number is
unknown.</p>
<p><b>See also</b> <a href="qsourcelocation.html#setLine">setLine</a>().</p>


<h3 class="fn"><a name="setColumn" />QSourceLocation.setColumn (<i>self</i>, int&#160;<i>newColumn</i>)</h3><p>Sets the column number to <i>newColumn</i>. 0 is an invalid
column number. The first column number is 1.</p>
<p><b>See also</b> <a href="qsourcelocation.html#column">column</a>().</p>


<h3 class="fn"><a name="setLine" />QSourceLocation.setLine (<i>self</i>, int&#160;<i>newLine</i>)</h3><p>Sets the line number to <i>newLine</i>. 0 is an invalid line
number. The first line number is 1.</p>
<p><b>See also</b> <a href="qsourcelocation.html#line">line</a>().</p>


<h3 class="fn"><a name="setUri" />QSourceLocation.setUri (<i>self</i>, <a href="qurl.html">QUrl</a>&#160;<i>newUri</i>)</h3><p>Sets the URI to <i>newUri</i>.</p>
<p><b>See also</b> <a href="qsourcelocation.html#uri">uri</a>().</p>


<h3 class="fn"><a name="uri" /><a href="qurl.html">QUrl</a> QSourceLocation.uri (<i>self</i>)</h3><p>Returns the resource that this <a href="qsourcelocation.html">QSourceLocation</a> refers to. For example,
the resource could be a file in the local file system, if the URI
scheme is <tt>file</tt>.</p>
<p><b>See also</b> <a href="qsourcelocation.html#setUri">setUri</a>().</p>


<h3 class="fn"><a name="__eq__" />bool QSourceLocation.__eq__ (<i>self</i>, <a href="qsourcelocation.html">QSourceLocation</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__hash__" />int QSourceLocation.__hash__ (<i>self</i>)</h3><h3 class="fn"><a name="__ne__" />bool QSourceLocation.__ne__ (<i>self</i>, <a href="qsourcelocation.html">QSourceLocation</a>&#160;<i>other</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;snapshot-4.9.5-9eb6aac99275 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.3</td></tr></table></div></address></body></html>